package com.zqsoft.bean;

import java.util.List;

public class CropBean implements Comparable<CropBean> {
    private int cropId;
    private String cropName;
    private String seedPic;
    private int stage;
    private int sellPrice;
    private int price;
    private int buyLevel;
    private List<String> allStagePic;
    private List<Integer> allStageTime;
    private String beginPic="resourcers/crop1/crop_start.png";
    private String endPic="resourcers/crop1/crop_end.png";

    // Constructor
    public CropBean() {
        this.cropId = cropId;
        this.cropName = cropName;
        this.seedPic = seedPic;
        this.stage = stage;
        this.sellPrice = sellPrice;
        this.price = price;
        this.buyLevel = buyLevel;
        this.allStagePic = allStagePic;
        this.allStageTime = allStageTime;
        this.beginPic = beginPic;
        this.endPic = endPic;
    }

    // Getters
    public int getCropId() {
        return cropId;
    }

    public String getCropName() {
        return cropName;
    }

    public String getSeedPic() {
        return seedPic;
    }

    public int getStage() {
        return stage;
    }

    public int getSellPrice() {
        return sellPrice;
    }

    public int getPrice() {
        return price;
    }

    public int getBuyLevel() {
        return buyLevel;
    }

    public List<String> getAllStagePic() {
        return allStagePic;
    }

    public List<Integer> getAllStageTime() {
        return allStageTime;
    }

    public String getBeginPic() {
        return beginPic;
    }

    public String getEndPic() {
        return endPic;
    }

    // Setters
    public void setCropId(int cropId) {
        this.cropId = cropId;
    }

    public void setCropName(String cropName) {
        this.cropName = cropName;
    }

    public void setSeedPic(String seedPic) {
        this.seedPic = seedPic;
    }

    public void setStage(int stage) {
        this.stage = stage;
    }

    public void setSellPrice(int sellPrice) {
        this.sellPrice = sellPrice;
    }

    public void setPrice(int price) {
        this.price = price;
    }

    public void setBuyLevel(int buyLevel) {
        this.buyLevel = buyLevel;
    }

    public void setAllStagePic(List<String> allStagePic) {
        this.allStagePic = allStagePic;
    }

    public void setAllStageTime(List<Integer> allStageTime) {
        this.allStageTime = allStageTime;
    }

    public void setBeginPic(String beginPic) {
        this.beginPic = beginPic;
    }

    public void setEndPic(String endPic) {
        this.endPic = endPic;
    }

    @Override
    public int compareTo(CropBean other) {
        // 首先比较购买等级
        int levelComparison = Integer.compare(this.buyLevel, other.buyLevel);
        if (levelComparison != 0) {
            return levelComparison; // 如果等级不同，返回等级比较结果
        }
        // 如果等级相同，则比较金币数
        return Integer.compare(this.price, other.price);
    }
}